package se.opendataexchange.simulator;

import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

public class Simulator {
	private static ScheduledThreadPoolExecutor executor = null;
	
	public static void addSimulatedValue(FunctionGenerator val){
		if(executor == null){
			executor = new ScheduledThreadPoolExecutor(50);
		}
		executor.scheduleAtFixedRate(val, 0, val.interval, TimeUnit.MILLISECONDS);
	}
}
